/* $Id:value.cc $ */
/*
   Copyright (C) 2007 by Jurjen Stellingwerff <jurjen@stwerff.xs4all.nl>
   Part of the Moros Project http://moros.sourceforge.net/

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License version 3.
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY.

   See the COPYING file for more details.
*/

#include <sstream>
#include <fstream>
#include "../general/util.h"
#include "value.h"
#include "../general/general.h"

value::value() {
    name="";
    nr=0;
}

// Field : name

const string value::getName() const { return name; }
void value::setName(const string v) { name=v; }

// Field : nr

const int value::getNr() const { return nr; }
void value::setNr(const int v) { nr=v; }
int value::operator<(const value &ck) const { return (this->nr < ck.nr)?1:0; }

void value::xml(ofstream &f, int l, int r) {
    f << ncpy(l, "  ") << "<value name=\"" << getName() <<
    "\" nr=\"" << getNr() <<
    "\"/>" << endl;
}
